package com.situ.web.service.impl;

import com.situ.web.dao.IBanjiDao;
import com.situ.web.dao.impl.BanjiDaoImpl;
import com.situ.web.pojo.Banji;
import com.situ.web.pojo.vo.BanjiCountVO;
import com.situ.web.service.IBanjiService;
import com.situ.web.util.LayUITableResult;

import java.util.List;

public class BanjiServiceImpl implements IBanjiService {
    private IBanjiDao banjiDao = new BanjiDaoImpl();

    @Override
    public List<BanjiCountVO> selectBanjiCount() {
        return banjiDao.selectBanjiCount();
    }

    @Override
    public LayUITableResult selectByPage(int page, int limit) {
        List<Banji> list = banjiDao.selectByPage(page, limit);
        int totalCount = banjiDao.selectTotalCount();

        return LayUITableResult.ok(totalCount, list);
    }

    @Override
    public List<Banji> selectAll() {
        return banjiDao.selectAll();
    }
}
